package emp.servlet;

import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.FileSystemResource;

import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;

/**
 * @author 叶枫
 * @date 2024/12/18.
 */


public class BaseServlet extends HttpServlet {
    private FileSystemResource fileSystemResource;

    @Override
    public void init(ServletConfig config) throws ServletException {
        super.init(config);


        // 从ServletConfig中获取contextConfigLocation参数
        String contextConfigLocation = getServletContext().getInitParameter("contextConfigLocation");
         fileSystemResource = new FileSystemResource(contextConfigLocation);

    }

    @Override
    public void destroy() {
        // 在Servlet销毁时，可以清理资源
        super.destroy();
    }
}
